]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
overview: Define ANIMATION_TIME earlier
authorFlorian Müllner <fmuellner@gnome.org>
Wed, 24 Jun 2020 13:28:53 +0000 (15:28 +0200)
committerFlorian Müllner <fmuellner@gnome.org>
Wed, 24 Jun 2020 13:41:12 +0000 (15:41 +0200)
Commit c7e597cf7278 tried to improve the slide animations when entering
the overview by using the same time as the overall overview animation,
but in fact broke the animation most of the times.

That is because the Overview imports OverviewControls before defining
the ANIMATION_TIME variable, so any javascript code that is evaluated
during that import will see the value as "undefined" (which is converted
to 0 for the animation).

Fix this by moving the ANIMATION_TIME variable before the imports instead
of the usual placement.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1331

js/ui/overview.js

index c5adf8e7d0fb12a0b1a7ad6a99a44581fff9c543..471a7e3b72782a98cfb2691a82b1e44fcb864907 100644 (file)
@@ -4,6 +4,10 @@
 const { Clutter, GLib, GObject, Meta, Shell, St } = imports.gi;
 const Signals = imports.signals;
 
+// Time for initial animation going into Overview mode;
+// this is defined here to make it available in imports.
+var ANIMATION_TIME = 250;
+
 const Background = imports.ui.background;
 const DND = imports.ui.dnd;
 const LayoutManager = imports.ui.layout;
@@ -14,9 +18,6 @@ const OverviewControls = imports.ui.overviewControls;
 const Params = imports.misc.params;
 const WorkspaceThumbnail = imports.ui.workspaceThumbnail;
 
-// Time for initial animation going into Overview mode
-var ANIMATION_TIME = 250;
-
 // Must be less than ANIMATION_TIME, since we switch to
 // or from the overview completely after ANIMATION_TIME,
 // and don't want the shading animation to get cut off